<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>it_seed</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="LIBIT Documentation"
HREF="index.html"><LINK
REL="UP"
HREF="refmanual.html"><LINK
REL="PREVIOUS"
TITLE="it_randpdf"
HREF="man.it-randpdf.html"><LINK
REL="NEXT"
TITLE="it_separable2D"
HREF="man.it-separable2d.html"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>LIBIT Documentation</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="man.it-randpdf.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="man.it-separable2d.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="MAN.IT-SEED"
></A
>it_seed</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN11000"
></A
><H2
>Name</H2
>it_seed&nbsp;--&nbsp;initialize the random number generator from a seed</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN11003"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><P
></P
><A
NAME="AEN11004"
></A
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include &lt;it/random.h&gt;
      </PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>void it_seed</CODE
>( unsigned int seed
        );</CODE
></P
><P
></P
></DIV
></DIV
><H2
>DESCRIPTION</H2
><P
> This function initializes the random number generator using the seed specified in <CODE
CLASS="PARAMETER"
>seed</CODE
>. A random number generator initialized with a given seed always produces the same sequence of numbers. Note that this function is unsecure (in the sense that it shouldn't be used in cryptographic applications) as the key space is limited to 32-bits.  </P
><H2
>RETURN VALUE</H2
><P
>    None
   </P
><H2
>EXAMPLE</H2
><PRE
CLASS="PROGRAMLISTING"
>&#13;#include &lt;random.h&gt;

...

double r;
it_randomize();
r = it_rand(); /* unknown value at each execution */
it_seed(0xdeadbeef);
r = it_rand(); /* always the same value at each execution */</PRE
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="man.it-randpdf.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="man.it-separable2d.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>it_randpdf</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="refmanual.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>it_separable2D</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>